package com.sywl.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.sywl.dao.UserDao;
import com.sywl.orm.User;
import com.sywl.service.UserService;
import com.sywl.util.DataGridModel;

@Service
public class UserServiceImpl implements UserService{

	@Autowired
	private UserDao userDao;
	
	@Transactional
	public void addUser(User user) {
		userDao.addUser(user);
	}

	@Transactional
	public List<User> listUser() {
		return userDao.listUser();
	}

	@Transactional
	public void removeUser(String userName) {
		userDao.removeUser(userName);
	}

	@Transactional
	public Map<String, Object> getPageList(DataGridModel dgm, User user)
			throws Exception {
		return userDao.getPageList(dgm, user);
	}

	@Transactional
	public User findById(Integer id) {
		return (User)userDao.findById(id);
	}
}
